.panel.panel-default
  .panel-heading
    .panel-title
      .html_title
        = @html_title||'部门管理'
      .pull-right
        = link_to_dialog '新增', new_base_department_path, class: 'btn btn-xs btn-primary'
  .panel-body
    table.table.table-bodered
      thead
        tr
          th 部门名
          th 操作
      tbody
        - @base_departments.each do |base_department|
          tr
            td = base_department.name
            td
              = link_to_dialog '编辑', edit_base_department_path(base_department), class: 'btn btn-xs btn-primary'
              = link_to '删除', base_department, data: { confirm: 'Are you sure?', remote: true}, method: :delete, class: 'btn btn-xs btn-danger push-5-l'
          - base_department.children.each do |child_dep|
            tr
              td
                .push-15-l = child_dep.name
              td
                = link_to_dialog '编辑', edit_base_department_path(child_dep), class: 'btn btn-xs btn-primary'
                = link_to '删除', child_dep, data: {confirm: 'Are you sure?', remote: true}, method: :delete, class: 'btn btn-xs btn-danger push-5-l'



